<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>活动列表 - 社交平台</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #3b82f6;
            --secondary: #6366f1;
            --success: #10b981;
            --warning: #f59e0b;
            --danger: #ef4444;
            --text-primary: #1e293b;
            --text-secondary: #64748b;
            --text-tertiary: #94a3b8;
            --bg-light: #f1f5f9;
            --bg-white: #ffffff;
            --border-light: #e2e8f0;
            --radius: 12px;
            --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 56px;
            padding-bottom: 70px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
            z-index: 1000;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
            border-bottom: 1px solid var(--border-light);
        }
        
        .nav-title {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            text-align: center;
            flex: 1;
        }
        
        .nav-btn {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 20px;
        }
        
        .nav-btn.primary {
            color: var(--primary);
        }
        
        /* 搜索栏 */
        .search-bar {
            padding: 12px 16px;
            background-color: var(--bg-white);
        }
        
        .search-form {
            position: relative;
        }
        
        .search-input {
            width: 100%;
            padding: 10px 16px 10px 40px;
            border-radius: 24px;
            border: 1px solid var(--border-light);
            background-color: var(--bg-light);
            font-size: 14px;
            outline: none;
        }
        
        .search-icon {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-tertiary);
            font-size: 16px;
        }
        
        /* 分类筛选 */
        .category-filter {
            padding: 0 16px;
            background-color: var(--bg-white);
            overflow-x: auto;
            white-space: nowrap;
        }
        
        .category-list {
            display: flex;
            gap: 16px;
            padding: 12px 0;
        }
        
        .category-item {
            padding: 6px 14px;
            border-radius: 18px;
            font-size: 14px;
            font-weight: 500;
            color: var(--text-secondary);
            background-color: var(--bg-light);
            white-space: nowrap;
        }
        
        .category-item.active {
            background-color: var(--primary);
            color: white;
        }
        
        /* 活动列表容器 */
        .event-list {
            padding: 12px 16px 20px;
        }
        
        /* 活动通用样式 */
        .event-card {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            margin-bottom: 16px;
            overflow: hidden;
            box-shadow: var(--shadow);
            transition: transform 0.2s ease;
        }
        
        .event-card:hover {
            transform: translateY(-2px);
        }
        
        .event-header {
            padding: 12px 16px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .event-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
            background-color: var(--primary);
        }
        
        .event-meta {
            flex: 1;
        }
        
        .event-host {
            font-size: 14px;
            color: var(--text-tertiary);
        }
        
        /* 活动内容样式 */
        .event-content {
            padding: 0 16px 12px;
        }
        
        .event-title {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 8px;
            line-height: 1.4;
        }
        
        .event-description {
            font-size: 14px;
            line-height: 1.5;
            color: var(--text-secondary);
            margin-bottom: 12px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        /* 活动时间地点 */
        .event-info {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-bottom: 12px;
            font-size: 13px;
            color: var(--text-tertiary);
        }
        
        .event-info-item {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        /* 图片布局 - 多图样式 */
        .event-images-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 4px;
            margin-bottom: 12px;
            border-radius: 8px;
            overflow: hidden;
        }
        
        .event-image {
            aspect-ratio: 1/1;
            overflow: hidden;
            position: relative;
        }
        
        .event-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }
        
        /* 图片布局 - 大图样式 */
        .event-image-large {
            width: 100%;
            border-radius: 8px;
            overflow: hidden;
            margin-bottom: 12px;
        }
        
        .event-image-large img {
            width: 100%;
            display: block;
        }
        
        /* 无图活动样式 */
        .event-no-image {
            padding: 12px 16px;
        }
        
        /* 活动标签 */
        .event-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 12px;
        }
        
        .event-tag {
            font-size: 12px;
            padding: 3px 10px;
            border-radius: 12px;
            background-color: var(--bg-light);
            color: var(--text-secondary);
        }
        
        /* 活动状态 */
        .event-status {
            position: absolute;
            top: 12px;
            right: 12px;
            font-size: 12px;
            padding: 3px 8px;
            border-radius: 4px;
            font-weight: 500;
            z-index: 10;
        }
        
        .status-upcoming {
            background-color: rgba(59, 130, 246, 0.9);
            color: white;
        }
        
        .status-live {
            background-color: rgba(239, 68, 68, 0.9);
            color: white;
        }
        
        .status-ended {
            background-color: rgba(100, 116, 139, 0.9);
            color: white;
        }
        
        /* 活动参与区 */
        .event-actions {
            padding: 8px 16px;
            border-top: 1px solid var(--border-light);
            display: flex;
            justify-content: space-between;
        }
        
        .event-stats {
            display: flex;
            align-items: center;
            gap: 16px;
            font-size: 13px;
            color: var(--text-tertiary);
        }
        
        .event-stat {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .event-join {
            padding: 6px 16px;
            border-radius: 20px;
            background-color: var(--primary);
            color: white;
            font-size: 14px;
            font-weight: 500;
            border: none;
        }
        
        .event-join.joined {
            background-color: var(--bg-light);
            color: var(--text-secondary);
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 60px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-light);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--text-tertiary);
            font-size: 11px;
            gap: 4px;
            text-decoration: none;
            flex: 1;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        .nav-icon {
            font-size: 20px;
        }
        
        /* 图片预览弹窗 */
        .image-preview-modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.9);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 2000;
        }
        
        .image-preview-modal.active {
            display: flex;
        }
        
        .preview-image {
            max-width: 90%;
            max-height: 80%;
            object-fit: contain;
        }
        
        .close-preview {
            position: absolute;
            top: 20px;
            right: 20px;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            border: none;
            font-size: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        /* 提示消息 */
        .toast {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 6px;
            z-index: 9999;
            font-size: 14px;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast.show {
            opacity: 1;
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-btn" id="backBtn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">活动列表</div>
        <button class="nav-btn primary" id="createBtn">
            <i class="fas fa-plus"></i>
        </button>
    </div>
    
    <!-- 搜索栏 -->
    <div class="search-bar">
        <form class="search-form">
            <i class="fas fa-search search-icon"></i>
            <input type="text" class="search-input" placeholder="搜索活动...">
        </form>
    </div>
    
    <!-- 分类筛选 -->
    <div class="category-filter">
        <div class="category-list">
            <div class="category-item active">全部活动</div>
            <div class="category-item">线上活动</div>
            <div class="category-item">线下聚会</div>
            <div class="category-item">讲座分享</div>
            <div class="category-item">体育赛事</div>
            <div class="category-item">文艺活动</div>
            <div class="category-item">公益志愿</div>
        </div>
    </div>
    
    <!-- 活动列表 -->
    <div class="event-list">
        <!-- 多图活动 -->
        <div class="event-card" data-type="multi-image">
            <div class="event-header">
                <img src="https://picsum.photos/id/64/100/100" alt="组织者头像" class="event-avatar">
                <div class="event-meta">
                    <div class="event-title">城市户外摄影采风活动</div>
                    <div class="event-host">摄影爱好者协会 主办</div>
                </div>
            </div>
            <div class="event-content">
                <div class="event-description">
                    周末一起探索城市隐藏美景，专业摄影师带队指导，适合各类水平爱好者参与，现场提供器材体验。
                </div>
                <div class="event-images-grid">
                    <div class="event-image">
                        <img src="https://picsum.photos/id/110/300/300" alt="活动图片1">
                    </div>
                    <div class="event-image">
                        <img src="https://picsum.photos/id/111/300/300" alt="活动图片2">
                    </div>
                    <div class="event-image">
                        <img src="https://picsum.photos/id/112/300/300" alt="活动图片3">
                    </div>
                </div>
                <div class="event-info">
                    <div class="event-info-item">
                        <i class="far fa-calendar-alt"></i>
                        <span>6月15日 14:00</span>
                    </div>
                    <div class="event-info-item">
                        <i class="fas fa-map-marker-alt"></i>
                        <span>中央公园</span>
                    </div>
                </div>
                <div class="event-tags">
                    <span class="event-tag">摄影</span>
                    <span class="event-tag">户外</span>
                    <span class="event-tag">周末</span>
                </div>
            </div>
            <div class="event-actions">
                <div class="event-stats">
                    <div class="event-stat">
                        <i class="fas fa-user"></i>
                        <span>42人参加</span>
                    </div>
                    <div class="event-stat">
                        <i class="far fa-comment"></i>
                        <span>18条留言</span>
                    </div>
                </div>
                <button class="event-join" data-event="1">
                    我要参加
                </button>
            </div>
        </div>
        
        <!-- 大图活动 -->
        <div class="event-card" data-type="single-image">
            <div class="event-header">
                <img src="https://picsum.photos/id/65/100/100" alt="组织者头像" class="event-avatar">
                <div class="event-meta">
                    <div class="event-title">2023年度科技创新峰会</div>
                    <div class="event-host">未来科技协会 主办</div>
                </div>
            </div>
            <div class="event-content">
                <div class="event-description">
                    汇聚行业精英，探讨前沿科技趋势，包含主题演讲、圆桌论坛和展示体验，不容错过的科技盛宴。
                </div>
                <div class="event-image-large">
                    <img src="https://picsum.photos/id/1/600/300" alt="峰会图片">
                    <span class="event-status status-upcoming">即将开始</span>
                </div>
                <div class="event-info">
                    <div class="event-info-item">
                        <i class="far fa-calendar-alt"></i>
                        <span>7月8日 09:00</span>
                    </div>
                    <div class="event-info-item">
                        <i class="fas fa-map-marker-alt"></i>
                        <span>国际会展中心</span>
                    </div>
                </div>
                <div class="event-tags">
                    <span class="event-tag">科技</span>
                    <span class="event-tag">峰会</span>
                    <span class="event-tag">付费</span>
                </div>
            </div>
            <div class="event-actions">
                <div class="event-stats">
                    <div class="event-stat">
                        <i class="fas fa-user"></i>
                        <span>328人参加</span>
                    </div>
                    <div class="event-stat">
                        <i class="far fa-comment"></i>
                        <span>156条留言</span>
                    </div>
                </div>
                <button class="event-join" data-event="2">
                    我要参加
                </button>
            </div>
        </div>
        
        <!-- 无图活动 -->
        <div class="event-card" data-type="no-image">
            <div class="event-header">
                <img src="https://picsum.photos/id/66/100/100" alt="组织者头像" class="event-avatar">
                <div class="event-meta">
                    <div class="event-title">线上读书会：当代文学作品赏析</div>
                    <div class="event-host">书香社 主办</div>
                </div>
            </div>
            <div class="event-content event-no-image">
                <div class="event-description">
                    本期将讨论《人类简史》的核心观点，分享阅读心得，欢迎所有文学爱好者参与，活动将通过Zoom进行。
                </div>
                <div class="event-info">
                    <div class="event-info-item">
                        <i class="far fa-calendar-alt"></i>
                        <span>6月10日 20:00</span>
                    </div>
                    <div class="event-info-item">
                        <i class="fas fa-laptop"></i>
                        <span>线上活动</span>
                    </div>
                </div>
                <div class="event-tags">
                    <span class="event-tag">阅读</span>
                    <span class="event-tag">线上</span>
                    <span class="event-tag">免费</span>
                </div>
            </div>
            <div class="event-actions">
                <div class="event-stats">
                    <div class="event-stat">
                        <i class="fas fa-user"></i>
                        <span>76人参加</span>
                    </div>
                    <div class="event-stat">
                        <i class="far fa-comment"></i>
                        <span>32条留言</span>
                    </div>
                </div>
                <button class="event-join joined" data-event="3">
                    已报名
                </button>
            </div>
        </div>
        
        <!-- 正在进行的活动 -->
        <div class="event-card" data-type="multi-image">
            <div class="event-header">
                <img src="https://picsum.photos/id/67/100/100" alt="组织者头像" class="event-avatar">
                <div class="event-meta">
                    <div class="event-title">城市马拉松比赛</div>
                    <div class="event-host">市体育局 主办</div>
                </div>
            </div>
            <div class="event-content">
                <div class="event-description">
                    年度城市马拉松盛会，包含全程马拉松、半程马拉松和迷你马拉松三个项目，欢迎市民前来观赛加油。
                </div>
                <div class="event-images-grid">
                    <div class="event-image">
                        <img src="https://picsum.photos/id/28/300/300" alt="马拉松图片1">
                        <span class="event-status status-live">正在进行</span>
                    </div>
                    <div class="event-image">
                        <img src="https://picsum.photos/id/29/300/300" alt="马拉松图片2">
                    </div>
                    <div class="event-image">
                        <img src="https://picsum.photos/id/30/300/300" alt="马拉松图片3">
                    </div>
                </div>
                <div class="event-info">
                    <div class="event-info-item">
                        <i class="far fa-calendar-alt"></i>
                        <span>今天 08:00</span>
                    </div>
                    <div class="event-info-item">
                        <i class="fas fa-map-marker-alt"></i>
                        <span>市民广场</span>
                    </div>
                </div>
                <div class="event-tags">
                    <span class="event-tag">体育</span>
                    <span class="event-tag">比赛</span>
                    <span class="event-tag">户外</span>
                </div>
            </div>
            <div class="event-actions">
                <div class="event-stats">
                    <div class="event-stat">
                        <i class="fas fa-user"></i>
                        <span>1200人参加</span>
                    </div>
                    <div class="event-stat">
                        <i class="far fa-comment"></i>
                        <span>532条留言</span>
                    </div>
                </div>
                <button class="event-join" data-event="4">
                    我要参加
                </button>
            </div>
        </div>
        
        <!-- 已结束的活动 -->
        <div class="event-card" data-type="single-image">
            <div class="event-header">
                <img src="https://picsum.photos/id/68/100/100" alt="组织者头像" class="event-avatar">
                <div class="event-meta">
                    <div class="event-title">公益植树活动</div>
                    <div class="event-host">绿色环保联盟 主办</div>
                </div>
            </div>
            <div class="event-content">
                <div class="event-description">
                    春季植树造林活动，为城市增添绿色，所有参与者将获得公益证书，感谢大家的积极参与。
                </div>
                <div class="event-image-large">
                    <img src="https://picsum.photos/id/106/600/300" alt="植树活动图片">
                    <span class="event-status status-ended">已结束</span>
                </div>
                <div class="event-info">
                    <div class="event-info-item">
                        <i class="far fa-calendar-alt"></i>
                        <span>3月12日 09:00</span>
                    </div>
                    <div class="event-info-item">
                        <i class="fas fa-map-marker-alt"></i>
                        <span>城市森林公园</span>
                    </div>
                </div>
                <div class="event-tags">
                    <span class="event-tag">公益</span>
                    <span class="event-tag">环保</span>
                    <span class="event-tag">志愿</span>
                </div>
            </div>
            <div class="event-actions">
                <div class="event-stats">
                    <div class="event-stat">
                        <i class="fas fa-user"></i>
                        <span>256人参加</span>
                    </div>
                    <div class="event-stat">
                        <i class="far fa-comment"></i>
                        <span>98条留言</span>
                    </div>
                </div>
                <button class="event-join joined" data-event="5">
                    已参加
                </button>
            </div>
        </div>
    </div>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-item">
            <i class="fas fa-home nav-icon"></i>
            <span>首页</span>
        </a>
        <a href="#" class="nav-item active">
            <i class="fas fa-calendar-alt nav-icon"></i>
            <span>活动</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-plus-circle nav-icon"></i>
            <span>发布</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-bell nav-icon"></i>
            <span>通知</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-user nav-icon"></i>
            <span>我的</span>
        </a>
    </div>
    
    <!-- 图片预览弹窗 -->
    <div class="image-preview-modal" id="imagePreviewModal">
        <img src="" alt="图片预览" class="preview-image" id="previewImage">
        <button class="close-preview" id="closePreview">
            <i class="fas fa-times"></i>
        </button>
    </div>
    
    <!-- 提示消息 -->
    <div class="toast" id="toast"></div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // DOM元素
        const backBtn = document.getElementById('backBtn');
        const createBtn = document.getElementById('createBtn');
        const categoryItems = document.querySelectorAll('.category-item');
        const joinButtons = document.querySelectorAll('.event-join');
        const eventImages = document.querySelectorAll('.event-image img, .event-image-large img');
        const imagePreviewModal = document.getElementById('imagePreviewModal');
        const previewImage = document.getElementById('previewImage');
        const closePreview = document.getElementById('closePreview');
        const toast = document.getElementById('toast');
        
        // 显示提示消息
        function showToast(message) {
            toast.textContent = message;
            toast.classList.add('show');
            
            clearTimeout(toast.timeout);
            toast.timeout = setTimeout(() => {
                toast.classList.remove('show');
            }, 2000);
        }
        
        // 打开图片预览
        function openImagePreview(src) {
            previewImage.src = src;
            imagePreviewModal.classList.add('active');
            document.body.style.overflow = 'hidden';
        }
        
        // 关闭图片预览
        function closeImagePreview() {
            imagePreviewModal.classList.remove('active');
            document.body.style.overflow = 'auto';
        }
        
        // 绑定事件
        function bindEvents() {
            // 返回按钮
            backBtn.addEventListener('click', () => {
                history.back();
                showToast('返回上一页');
            });
            
            // 创建活动按钮
            createBtn.addEventListener('click', () => {
                showToast('进入创建活动页面');
            });
            
            // 分类筛选
            categoryItems.forEach(item => {
                item.addEventListener('click', function() {
                    // 移除所有active类
                    categoryItems.forEach(i => i.classList.remove('active'));
                    // 添加当前active类
                    this.classList.add('active');
                    showToast(`已筛选: ${this.textContent}`);
                });
            });
            
            // 参加活动按钮
            joinButtons.forEach(button => {
                button.addEventListener('click', function() {
                    const eventId = this.getAttribute('data-event');
                    
                    if (this.classList.contains('joined')) {
                        this.classList.remove('joined');
                        this.textContent = '我要参加';
                        showToast('已取消报名');
                    } else {
                        this.classList.add('joined');
                        this.textContent = '已报名';
                        showToast('报名成功');
                    }
                });
            });
            
            // 活动图片点击预览
            eventImages.forEach(img => {
                img.addEventListener('click', function() {
                    openImagePreview(this.src);
                });
            });
            
            // 关闭图片预览
            closePreview.addEventListener('click', closeImagePreview);
            
            // 点击预览背景关闭
            imagePreviewModal.addEventListener('click', function(e) {
                if (e.target === this) {
                    closeImagePreview();
                }
            });
        }
        
        // 初始化
        function init() {
            bindEvents();
        }
        
        // 启动
        init();
    </script>
</body>
</html>
